export default class StringUtils{

    static REGEX_MOBILE = /^1[3456789]\d{9}$/;
    static REGEX_ACCOUNT = /^[\\u4E00-\\u9FA5|a-zA-Z][\w\\u4E00-\\u9FA5|0-9a-zA-Z]*$/;

    static isEmpty(str){
      if(str==null||str==undefined||str==""||str=="null"||str=="undefined"||str=={})
        return true;
      if(str.length==0)
        return true;
      return false;
    }


    static clear(str){
      if(this.isEmpty(str)){
        return "";
      }
      return str;
    }

    static isMobile(value){
        let is = true;
        if (value) {
            is = StringUtils.REGEX_MOBILE.test(value);
        } else {
            is = false;
        }
        return is;
    }

    static isAccount(value){
        let is = true;
        if (value) {
            is = StringUtils.REGEX_ACCOUNT.test(value);
        } else {
            is = false;
        }
        return is;
    }


  }
  